package com.julian.factoryPattern.abstractFactoryPattern.store;

import com.julian.factoryPattern.abstractFactoryPattern.factory.NYPizzaIngredientFactory;
import com.julian.factoryPattern.abstractFactoryPattern.factory.PizzaIngredientFactory;
import com.julian.factoryPattern.abstractFactoryPattern.pizza.CheesePizza;
import com.julian.factoryPattern.abstractFactoryPattern.pizza.ClamPizza;
import com.julian.factoryPattern.abstractFactoryPattern.pizza.Pizza;


public class NYPizzaStore extends PizzaStore {
    @Override
    Pizza createPizza(String type) {
        Pizza pizza = null;
        PizzaIngredientFactory pizzaIngredientFactory =
                new NYPizzaIngredientFactory();
        if (type.equals("cheese")){
            pizza = new CheesePizza(pizzaIngredientFactory);
            pizza.setName("New York Style Cheese Pizza");
        }else if (type.equals("clam")){
            pizza = new ClamPizza(pizzaIngredientFactory);
            pizza.setName("New York Style Clam Pizza");
        }
        return pizza;
    }
}
